<template>
  <div>
    <div id="tab">
      <div class="Totalorder tab">
        <h2 class="iconfont icon-dingdan"></h2>
        <div class="data">
          <p>总订单</p>
          <span>数据</span>
        </div>
      </div>
      <div class="Totalsales tab">
        <h2 class="iconfont icon-dingdan"></h2>
        <div class="data">
          <p>总订单</p>
          <span>数据</span>
        </div>
      </div>
      <div class="Todayorder tab">
        <h2 class="iconfont icon-dingdan"></h2>
        <div class="data">
          <p>总订单</p>
          <span>数据</span>
        </div>
      </div>
      <div class="Todaysales tab">
        <h2 class="iconfont icon-dingdan"></h2>
        <div class="data">
          <p>总订单</p>
          <span>数据</span>
        </div>
      </div>
    </div>

    <div id="boxe"><div id="echart"></div></div>
    
  </div>
</template>

<script>
export default {
  data() {
    return {
      option: {
        title: {
          text: "Stacked Line",
        },
        tooltip: {
          trigger: "axis",
        },
        legend: {
          data: ["Email", "Union Ads", "Video Ads", "Direct", "Search Engine"],
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          containLabel: true,
        },
        toolbox: {
          feature: {
            saveAsImage: {},
          },
        },
        xAxis: {
          type: "category",
          boundaryGap: false,
          data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
        },
        yAxis: {
          type: "category"
        },
        series: [
          {
            name: "Email",
            type: "line",
            stack: "Total",
            data: [120, 132, 101, 134, 90, 230, 210],
          },
          {
            name: "Union Ads",
            type: "line",
            stack: "Total",
            data: [220, 182, 191, 234, 290, 330, 310],
          },
          {
            name: "Video Ads",
            type: "line",
            stack: "Total",
            data: [150, 232, 201, 154, 190, 330, 410],
          },
          {
            name: "Direct",
            type: "line",
            stack: "Total",
            data: [320, 332, 301, 334, 390, 330, 320],
          },
          {
            name: "Search Engine",
            type: "line",
            stack: "Total",
            data: [820, 932, 901, 934, 1290, 1330, 1320],
          },
        ],
      },
    };
  },

  methods: {
    drawpLine() {
      let myChart = this.$echarts.init(document.getElementById("echart"));
      // 绘制图表
      myChart.setOption(this.option);
    },
  },
  mounted() {
    this.drawpLine();
  },
};
</script>

<style lang="less" scoped>
#tab {
  width: 100%;
  height: 200px;

  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  .tab {
    width: 20%;
    height: 80%;
    background-color: white;
    display: flex;
    h2 {
      width: 50%;
      height: 100%;
      font-size: 70px;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .data {
      width: 50%;
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      p {
        color: #cfcfcf;
        font-size: 30px;
      }
      span {
        font-size: 24px;
      }
    }
  }
}
#boxe{
    
    width: 100%;
    height: 500px;
}
#echart {
  width: 100%;
  height: 100%;
  background-color: white;
}
</style>